package com.fml.dahua;

import java.util.*;

public class DemoList {
    public static void main(String[] args) {
        ArrayList<Integer> list =
                new ArrayList<Integer>();
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);
        list.add(5);
        list.add(6);
        list.add(7);
        list.add(8);
        list.add(9);
        list.add(10);

        System.out.println("插入前");
        printList(list);
        System.out.println();
        Integer e = 99;
        list.add(6, e);
        System.out.println("插入后");
        printList(list);
        System.out.println();
        System.out.println("==============");
        Set set = new HashSet();
        Stack stack = new Stack();
        stack.push(1);
        stack.push(2);
        stack.push(3);
        Object o = stack.pop();
        System.out.println(o);
        o = stack.pop();

        System.out.println(o);
        o = stack.pop();
        System.out.println(o);

    }

    private static void printList(List<Integer> list) {
        for (Integer i : list) {
            System.out.print(i + ", ");
        }
    }
}
